{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(['The image shows a man and a woman standing side by side', ' The woman is on the left side of the image and is wearing a long, \\nflowy dress with a floral pattern in shades of orange, yellow, and white', ' \\nShe has long dark hair and is looking directly at the camera with a serious expression', ' \\nThe man on the right side is also wearing a white button-down shirt and black pants', ' \\nHe is also looking straight ahead with a slight smile on his face', ' The background is black', '\\n'],)\n",
      "('The image shows a man and a woman standing side by side. The woman is on the left side of the image and is wearing a long, \\nflowy dress with a floral pattern in shades of orange, yellow, and white. \\nShe has long dark hair and is looking directly at the camera with a serious expression. \\nThe man on the right side is also wearing a white button-down shirt and black pants. \\nHe is also looking straight ahead with a slight smile on his face.\\n',)\n",
      "(5,)\n"
     ]
    }
   ],
   "source": [
    "from XP_Utils_Join_List import * \n",
    "from XP_Utils_LineOfString import *\n",
    "from XP_Utils_Split_String import *\n",
    "\n",
    "str = \"\"\"The image shows a man and a woman standing side by side. The woman is on the left side of the image and is wearing a long, \n",
    "flowy dress with a floral pattern in shades of orange, yellow, and white. \n",
    "She has long dark hair and is looking directly at the camera with a serious expression. \n",
    "The man on the right side is also wearing a white button-down shirt and black pants. \n",
    "He is also looking straight ahead with a slight smile on his face. The background is black.\n",
    "\"\"\"\n",
    "\n",
    "sp = XP_Utils_Split_String()\n",
    "list = sp.sample(str, \".\")\n",
    "print(list)\n",
    "\n",
    "jo = XP_Utils_Join_List()\n",
    "result = jo.sample(list[0],'.','background', '', '', '',True,True)\n",
    "print(result)\n",
    "\n",
    "li = XP_Utils_LineOfString()\n",
    "line = li.sample(str)\n",
    "print(line)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(tensor([[[[0.5176, 0.4000, 0.3216],\n",
       "           [0.5176, 0.4039, 0.3216],\n",
       "           [0.5176, 0.4039, 0.3255],\n",
       "           ...,\n",
       "           [0.4510, 0.4000, 0.3529],\n",
       "           [0.4510, 0.4000, 0.3529],\n",
       "           [0.4510, 0.4039, 0.3569]],\n",
       " \n",
       "          [[0.5176, 0.4000, 0.3216],\n",
       "           [0.5176, 0.4000, 0.3216],\n",
       "           [0.5176, 0.4039, 0.3216],\n",
       "           ...,\n",
       "           [0.4471, 0.4000, 0.3529],\n",
       "           [0.4510, 0.4000, 0.3569],\n",
       "           [0.4471, 0.4000, 0.3529]],\n",
       " \n",
       "          [[0.5176, 0.4039, 0.3255],\n",
       "           [0.5176, 0.4039, 0.3255],\n",
       "           [0.5216, 0.4078, 0.3294],\n",
       "           ...,\n",
       "           [0.4471, 0.3922, 0.3451],\n",
       "           [0.4471, 0.3922, 0.3490],\n",
       "           [0.4431, 0.3961, 0.3490]],\n",
       " \n",
       "          ...,\n",
       " \n",
       "          [[0.8118, 0.6824, 0.5490],\n",
       "           [0.8118, 0.6863, 0.5529],\n",
       "           [0.8078, 0.6784, 0.5490],\n",
       "           ...,\n",
       "           [0.5294, 0.4667, 0.4392],\n",
       "           [0.5176, 0.4588, 0.4275],\n",
       "           [0.5216, 0.4627, 0.4353]],\n",
       " \n",
       "          [[0.8118, 0.6784, 0.5451],\n",
       "           [0.8118, 0.6745, 0.5490],\n",
       "           [0.8118, 0.6784, 0.5490],\n",
       "           ...,\n",
       "           [0.4824, 0.4196, 0.3843],\n",
       "           [0.4627, 0.4000, 0.3686],\n",
       "           [0.4745, 0.4118, 0.3765]],\n",
       " \n",
       "          [[0.8078, 0.6824, 0.5490],\n",
       "           [0.8078, 0.6745, 0.5451],\n",
       "           [0.8078, 0.6784, 0.5451],\n",
       "           ...,\n",
       "           [0.8667, 0.8510, 0.8392],\n",
       "           [0.8627, 0.8471, 0.8353],\n",
       "           [0.8627, 0.8471, 0.8353]]]]),)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from XP_Utils_Image_Concat import * \n",
    "\n",
    "\n",
    "arr = [{\"url\":\"https://ruiii-app.oss-cn-hangzhou.aliyuncs.com/project/849042677232287744/4b0eb4bc-1b02-435a-9f56-53187a9d7a4c.png\",\"type\":\"url\"},{\"url\":\"https://ruiii-app.oss-cn-hangzhou.aliyuncs.com/project/849042677232287744/ade98eeb-5532-4efd-9eba-fa2c7a7fc922.png\",\"name\":\"458afded-2d51-4ee0-9d0e-094dad9bfb7e.png\",\"size\":391538},{\"url\":\"https://ruiii-app.oss-cn-hangzhou.aliyuncs.com/project/849042677232287744/2b22cad9-b027-4932-933e-c231ce9f5996.png\",\"type\":\"url\"},{\"url\":\"https://ruiii-app.oss-cn-hangzhou.aliyuncs.com/project/849042677232287744/7aeb8131-bfa8-4f16-a1ee-29e16c773aeb.png\",\"type\":\"url\"},{\"url\":\"https://ruiii-app.oss-cn-hangzhou.aliyuncs.com/project/849042677232287744/656ad7d7-98e7-4250-943d-e7ee621e55ff.png\",\"type\":\"url\"}]\n",
    "\n",
    "image_urls= \"\"\n",
    "for i in arr:\n",
    "    image_urls += i[\"url\"] + \",\"\n",
    "con = XP_Utils_Image_Concat()\n",
    "image = con.sample(image_urls)\n",
    "image"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
